室內設計
 
尚佶網頁設計主選單
網頁美編設計製作
行動手機‧行動電視
網頁設計
網頁設計
最新訊息:
  網頁設計全球效應
  網頁設計的行銷效用?
作品賞晰 :
  昇華文件櫃有限公司
Shen Hua Filing Cabinet
File Cabinet
  美和美吊扇公司
  HCB AUTO TOOLS
  逸通房屋拆除工程
  鳳凰企業社
  國立中正大學行銷創意研究中心
  銘輝毛刷有限公司
  大業國中 嘉義市 97 海洋教育計畫
  鳳凰冰涼巾公司
  進泉瓜子
  金鴻勝酒廠
  嘉義市97教學卓越計畫
  鉅祥工具開發有限公司
更多作品 >>
 

 

 

 

 

 

 

 

filing cabinet file cabinet 新恩嘉義神經內科 新恩嘉義神經內科

 

 
 
網頁設計+創意=100%網站   
如何製作CSS水平選單

網頁瀏覽器-世界之窗

網頁美編

網頁設計如何製作CSS水平選單<hr>-網頁水平線-↑向上

 通常我們在網頁設計水平選單時,大部份會設計成用圖片做滑鼠滑過顏色的變換,有的可能使用flash做設計,或用java去定義,不過對於一位網頁設計師來講,可能不是很正規的做法。如果一個網頁所有的版面格式都用css去做定義,網頁就會減少一些不必要的檔案大小。管理起來也比較方便。以下就要介紹網頁設計如何用CSS去製作網頁水平選單。以下CSS程式碼請貼於head與head之間。

a018.jpg

 

 

 

 

<script>
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName=="SPAN") {
node.onmouseover=function() {this.className+=" over";}
node.onmouseout=function() {this.className=this.className.replace(" over", "");}
}
}
}
}
window.onload=startList;
</script>
<style>
body {
  font: normal 11px verdana;
}
div#nav{
  border-left: 1px solid #ccc;
}
span {
  margin: 0px;
  padding: 0px;
  list-style: none;
  width: 120px; /* Width of Menu Items */
  position: relative;
  border: 1px solid #ccc;
  border-left: 0px;
}
span div span {
  border: 1px solid #ccc;
  border-top: 0px;
}
span div {
  position: absolute;
  left: -1px;
  top: 24px; /* Set 1px less than menu width */
  display: none;
}

/* Styles for Menu Items */
div span a {
  width: 100%;
  text-decoration: none;
  color: #777;
  background: #fff; /* IE6 Bug */
  padding: 5px;
}

div span a:hover { color: #E2144A; background: #f9f9f9; } /* Hover Styles */
   
span div span a { padding: 2px 5px; } /* Sub Menu Styles */
   
span:hover div, span.over div { display: inline; } /* The magic */
</style>

<div id="nav">
  <span><a href="#">chinahtml</a>
  <div>
  </div>
  </span>
  <span><a href="#">About</a>
  <div>
    <span><a href="#">History</a></span>
    <span><a href="#">Team</a></span>
    <span><a href="#">Offices</a></span>
  </div>
  </span>
  <span><a href="#">Services</a>
  <div>
    <span><a href="#">Web Design</a></span>
    <span><a href="#">Internet Marketing</a></span>
    <span><a href="#">Hosting</a></span>
    <span><a href="#">Domain Names</a></span>
    <span><a href="#">Broadband</a></span>
  </div>
  </span>
  <span><a href="#">Contact Us</a>
  <div>
    <span><a href="#">United Kingdom</a></span>
    <span><a href="#">France</a></span>
    <span><a href="#">USA</a></span>
    <span><a href="#">Austraspana</a></span>
  </div>
  </span>
</div>

網頁美編
網頁美編
< 上一頁   下一頁 >
top_18.jpg
 
 
尚佶網頁設計 2011 © copyright 版權所有.All rights reserved.
 
©2011 Sungie